﻿using System;

namespace enyo
{
    public class Dashboard : Component
    {
        /// <summary>
        /// Array of layer objects specifying contents of dashboard.
        /// </summary>
        public Layer[] Layers { get; set; }

        /// <summary>
        /// Optional path to small icon to display when this dashboard window is hidden.
        /// </summary>
        public string SmallIcon { get; set; }

        /// <summary>
        /// Fired when user taps the icon portion of a dashboard. Event includes the top layer object, and mouse event.
        /// </summary>
        //TODO:mouse event??
        public EnyoEvent<Control, object> onIconTap;

        /// <summary>
        /// Fired when user taps the message portion of a dashboard. Event includes the top layer object, and mouse event.
        /// </summary>
        //TODO:mouse event??
        public EnyoEvent<Control, object> onMessageTap;

        /// <summary>
        /// Fired when user taps anywhere in a dashboard. Event includes the top layer object, and mouse event.
        /// </summary>
        //TODO:??
        public EnyoEvent<Control, object> onTap;

        /// <summary>
        /// Fired when user swipes away the dashboard (or the last layer). 
        /// NOT sent when it is programmatically closed by emptying the layer stack.
        /// </summary>
        public EnyoEvent<Control> onUserClose;

        /// <summary>
        /// Fired when user swipes a dashboard layer away, unless it's the last one (that's onUserClose instead).        
        /// </summary>
        //TODO:Event includes the top layer object.
        public EnyoEvent<Control, object> onLayerSwipe;

        /// <summary>
        /// Fired when the dashboard window is displayed/maximized.
        /// </summary>
        public EnyoEvent<Control> onDashboardActivated;

        /// <summary>
        /// Fired when user dashboard window is concealed/minimized.
        /// </summary>
        public EnyoEvent<Control> onDashboardDeactivated;

        /*TODO:Not found in source code?
        dbActivated: function(inSender)
        dbDeactivated: function(inSender)
        dbTapped: function(inSender, topLayer, event)
        iconTapped: function(inSender, topLayer, event)
        layerSwiped: function(inSender, topLayer)
        msgTapped: function(inSender, topLayer, event)
        userClosed: function(inSender)
        */

        public Layer Pop()
        {
            return null;
        }

        public void Push(Layer layer)
        {
        }

        public void SetLayers(Layer[] layers)
        {
        }
    }

    public class Layer
    {
        /// <summary>
        /// path to icon image for this layer.
        /// </summary>
        public string Icon;

        /// <summary>
        /// First line of text, bold by default.  HTML is automatically escaped.
        /// </summary>
        public string Title;

        /// <summary>
        /// Second line of text, HTML is automatically escaped.
        /// </summary>
        public string Text;
    }
}
